package cn.wolfcode.trip.base.domain;

import cn.wolfcode.trip.base.util.JSONUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@Setter
@Getter
public class Syspush extends BaseDomain{

    private String title;  // 标题

    @JsonFormat(pattern = "yyyy-MM-dd ")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date releasetime;  // 发布时间

    private String releasename;  // 发布者

    private String content;  //  内容

    public String getJsonString(){
        Map<String,Object> map = new HashMap<>();
        map.put("id",getId());
        map.put("title",title);
        map.put("content",content);
        return JSONUtil.toJSONString(map);
    }
}